package org.monkey.example.order.entity.po;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.monkey.example.order.entity.dto.OrderDto;

@Data
@TableName(value = "test_order")
@NoArgsConstructor
public class OrderPo {

  @TableId
  private Long id;

  private String orderNumber;

  private Long accountId;

  private BigDecimal amount;

  public OrderPo(OrderDto orderDto) {
    this.id = orderDto.getId();
    this.accountId = orderDto.getAccountId();
    this.amount = orderDto.getAmount();
    this.orderNumber = orderDto.getOrderNumber();
  }
}
